package com.example.hospitalmanagement.activity

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.example.hospitalmanagement.R
import com.example.hospitalmanagement.adapter.HealthEducationActivityAdapter
import com.example.hospitalmanagement.bean.HealthEducationItem

/**
 * 健康宣教Activity
 *
 * 位置:医院综合-健康宣教
 */
class HealthEducationActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_health_education)
        initView()
    }

    /**
     * 条目布局显示
     */
    private fun initView() {
        val educationItem: RecyclerView = findViewById(R.id.education_item)
        educationItem.layoutManager = LinearLayoutManager(this)
        val dataList: MutableList<HealthEducationItem> = mutableListOf()
        for (index in 1..5) {
            dataList.add(
                HealthEducationItem(
                    "【科普知识】关于白癜风,你一定要知道的那些事",
                    R.mipmap.education_item_test,
                    "2022-01-01"
                )
            )
        }
        val adapter = HealthEducationActivityAdapter(this)
        adapter.dataList = dataList
        educationItem.adapter = adapter
    }
}